package com.woniuxy.ticketcinema.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.woniuxy.ticketcinema.exception.UpdatValidationException;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author yanqiwei
 * @since 2021-02-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("ticket_cinema")
public class Cinema implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "id不能为空",groups = UpdatValidationException.class)
    @Min(value = 1,message = "id必须大于等于1",groups = UpdatValidationException.class)
    private Integer id;

    @NotNull(message = "影院名不能为空")
    @Length(min = 2,max = 10,message = "影院名长度需在{min}-{max}")
    private String name;

    @NotNull(message = "地址不能为空")
    @Length(min = 2,max = 10,message = "地址长度需在{min}-{max}")
    private String address;

    @NotNull(message = "电话不能为空")
    @Length(min = 2,max = 10,message = "电话长度需在{min}-{max}")
    private String telphone;



}
